<template>
  <section>
    <span :style="{display:'block',height:widget.config.height*4+'px'}">
      <span style="border-top:5px solid #000;font-size:16px;font-weight: bold;">No.{{widget.data.sn}}</span>
    </span>
    <el-dialog title="配置小部件默认信息"
               :visible.sync="showConfDialog" width="45%">
      <el-form style="margin:15px 0;">
        <el-form-item label="高度">
          <el-input size="small" v-model="widget.config.height">
            <template slot="append">mm</template>
          </el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="confCancel">取消</el-button>
        <el-button type="primary" @click="confDone">确定</el-button>
      </span>
    </el-dialog>
  </section>
</template>

<script>
  export default {
    name: "page-report-sn",
    props: ['widget','reportData', 'showConfDialog'],
    created(){
      if(Object.getOwnPropertyNames(this.widget.data).length < 2){
        this.widget.data.sn = this.reportData.report.sn
        this.$emit('done', null)
      }
    },
    methods: {
      confCancel(e) {
        this.$emit('done', null)
      },
      confDone(e) {
        this.$emit('done', this.widget)
      }
    }
  }
</script>

<style scoped>

</style>
